package cn.whr.server1.controller;

import cn.whr.server1.entity.ResponseDTO;
import cn.whr.server1.entity.UserEntity;
import cn.whr.server1.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private IUserService userService;

    @RequestMapping("/loginStep1")
    public ResponseDTO loginStep1(UserEntity user) {// 假设用户名,密码,电话号码格式在前端已检验
        return userService.doStep1(user);
    }

    @RequestMapping("/loginStep2")
    public ResponseDTO loginStep2(UserEntity user) {// 假设前端验证 用户名没变, 验证码正确
        return userService.doStep2(user);
    }

    @RequestMapping("/loginStep3")
    public ResponseDTO loginStep3(UserEntity user) {
        return userService.doStep3(user);
    }

}
